package controller

import (
	"github.com/gin-gonic/gin"
	"shop-bean/request"
	"shop-common/library/serializer"
	"shop-service/business"
)

type StoreProductController struct {
}

func (s *StoreProductController) Page(ctx *gin.Context) {

}

func (s *StoreProductController) Info(ctx *gin.Context) {

}

func (s *StoreProductController) Save(ctx *gin.Context) {
	form := request.StoreProductRequest{}
	if err := serializer.Verify(ctx, &form); err != nil {
		serializer.Fail(ctx, err.Error())
		return
	}

}

func (s *StoreProductController) Update(ctx *gin.Context) {

}

func (s *StoreProductController) Delete(ctx *gin.Context) {

}

//生成规格列表
func (s *StoreProductController) IsFormatAttr(ctx *gin.Context) {
	isOk, err := business.ServiceImpl().StoreProduct.CheckActivity(0)
	if err != nil && !isOk {
		serializer.Fail(ctx, err.Error())
		return
	}

	business.ServiceImpl().StoreProduct.FindAttr()
}
